<!DOCTYPE html>
<html>
<head>
	<title>角色管理</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="/static/layui/css/layui.css?t=1510415843040" media="all">
	<script src="/static/layui/layui.all.js"></script>
	<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
	<script src="/static/js/webutil.js?t=123"></script>
</head>
<body>
<div class="layui-fluid">
	<div class="layui-row">
	<fieldset class="layui-elem-field layui-field-title">
  		<legend>角色管理</legend>
	</fieldset>
	<#assign page=param.page/>
 	<#assign list=param.page.list/>
	<form id="submitForm" action="/base/sysrole/list.htm" autocomplete="on" method="get">
		<div class="layui-inline">
			<label>角色名称</label>
			<div class="layui-input-inline">
				<input type="text" name="name" value="${param.name!}" autocomplete="off" class="layui-input">
			</div>
			<label>修改时间</label>
			<div class="layui-input-inline">
				<input type="text" id="edittimeBegin" name="exParam['edittimeBegin']" value="${param.exParam.edittimeBegin!}" autocomplete="off" class="layui-input">
			</div>
			-
			<div class="layui-input-inline">
				<input type="text" id="edittimeEnd" name="exParam['edittimeEnd']" value="${param.exParam.edittimeEnd!}" autocomplete="off" class="layui-input">
			</div>
		</div>
		<div style="padding-top: 10px">
			<div class="layui-btn-group">
				<button class="layui-btn layui-btn-sm layui-btn-primary" type="button" onclick="addData(formUrl)">
					<i class="layui-icon">&#xe608;</i>新增
				</button>
				<button class="layui-btn layui-btn-sm layui-btn-danger" type="button" onclick="deleteData(deleteUrl)">
					<i class="layui-icon">&#xe640;</i>删除
				</button>
			</div>
			<div style="float: right;">
				<button class="layui-btn layui-btn-radius layui-btn-sm" lay-submit lay-filter="submitForm">
					<i class="layui-icon">&#xe615;</i>查询
				</button>
				<button type="button" class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius" onclick="location.reload();">
					<i class="layui-icon">&#xe63d;</i>刷新
				</button>
				<button type="button" class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius" onclick="formReset()">
					<i class="layui-icon">&#x1002;</i>重置
				</button>
			</div>
		</div>
	</form>
	<table class="layui-table" id="main-table" lay-filter="main-table" lay-even>
		<thead>
			<tr>
				<th lay-data="{field:'id',checkbox:true}"></th>
	 			<th lay-data="{field:'name'}">角色名称</th>
	 			<th lay-data="{field:'addtime'}">提交时间</th>
	 			<th lay-data="{field:'edittime'}">修改时间</th>
				<th lay-data="{field:'handleZone'}">操作</th>
			</tr>
		</thead>
		<tbody>
			<#list list as sysRole>
			<tr>
				<td>${sysRole.id}</td>
	 			<td>${sysRole.name!''}</td>
				<td>${sysRole.addtime?string('yyyy-MM-dd HH:mm:ss')}</td>
				<td>${sysRole.edittime?string('yyyy-MM-dd HH:mm:ss')}</td>
				<td>
					<div class="layui-btn-group">
						<button class="layui-btn layui-btn-xs layui-btn-primary" onclick="viewData(formUrl,'${sysRole.id}')">查看</button>
						<button class="layui-btn layui-btn-xs layui-btn-normal" onclick="editData(formUrl,'${sysRole.id}')">编辑</button>
						<button class="layui-btn layui-btn-xs layui-btn-danger" onclick="deleteData(deleteUrl,'${sysRole.id}')">删除</button>
						<button class="layui-btn layui-btn-xs" onclick="permission('${sysRole.id}')">赋予权限</button>
					</div>
				</td>
			</tr>
			</#list>
		</tbody>
	</table>
	<#include "/util/page.ftl">
	</div>
</div>
<script type="text/javascript">

	var formUrl = "/base/sysrole/form.htm";
	var deleteUrl = "/base/sysrole/delete.json";

	layui.laydate.render({
		  elem: '#addtimeBegin'
	});
	layui.laydate.render({
		  elem: '#addtimeEnd'
	});
	layui.laydate.render({
		  elem: '#edittimeBegin'
	});
	layui.laydate.render({
		  elem: '#edittimeEnd'
	});
	
	function permission(roleid){
		layer.open({
			type : 2,
			title : '赋予权限',
			closeBtn : 1,
			maxmin : true,
			area:['25%','80%'],
			content : '/base/sysrole/permission.htm?roleid='+roleid
		});
	}
</script>
</body>
</html>